"""StudentProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from app import views

urlpatterns = [
    path("", views.login),
    path("admin/", admin.site.urls),
    path("login/", views.login),
    path("index/", views.index),
    path("course/", views.course),
    path("edit_course/<int:course_id>/", views.edit_course),  # 选课信息界面修改功能
    path("del_course/<int:course_id>/", views.del_course),
    path("select_course/", views.select_course),
    
    # 课程管理路由
    path("course_manage/", views.course_manage),
    path("course_add/", views.course_add),
    path("course_edit/<int:course_id>/", views.course_edit),
    path("course_delete/<int:course_id>/", views.course_delete),
    
    # 成绩、消费和图书借阅路由
    path("mark/", views.mark),
    path("mark/chart/", views.MarkChartView.as_view()),  # 添加成绩图表路由
    path("money/", views.money_info),
    path("money/chart/", views.MoneyChartView.as_view()),  # 添加消费图表路由
    path("book/", views.book_info),
    path("book/chart/", views.BookChartView.as_view()),  # 添加图书借阅统计图表路由
    
    # 图书管理路由
    path("all_books/", views.all_books),
    path("borrow_book/<int:book_id>/", views.borrow_book),
    path("return_book/<int:book_id>/", views.return_book),
    path("add_book/", views.add_book),
    path("edit_book/<int:book_id>/", views.edit_book),  # 添加图书修改路由
    path("delete_book/<int:book_id>/", views.delete_book),  # 添加图书删除路由
    
    # 退出登录
    path("logout/", views.logout),
]
